package com.aidex.business.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.BaseEntity;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.business.mapper.BusPurchaseMapper;
import com.aidex.business.domain.BusPurchase;
import com.aidex.business.service.BusPurchaseService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 采购单信息Service业务层处理
 * @author cq
 * @email 382425530@qq.com
 * @date 2023-06-20
 */
@Service
@Transactional(readOnly = true)
public class BusPurchaseServiceImpl extends BaseServiceImpl<BusPurchaseMapper, BusPurchase> implements BusPurchaseService {

    private static final Logger log = LoggerFactory.getLogger(BusPurchaseServiceImpl.class);

    /**
     * 获取单条数据
     * @param busPurchase 采购单信息
     * @return 采购单信息
     */
    @Override
    public BusPurchase get(BusPurchase busPurchase) {
        BusPurchase dto = super.get(busPurchase);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 采购单信息id
     * @return 采购单信息
     */
    @Override
    public BusPurchase get(String id) {
        BusPurchase dto = super.get(id);
        return dto;
    }

    /**
     * 查询采购单信息列表
     * @param busPurchase 采购单信息
     * @return 采购单信息
     */
    @Override
    public List<BusPurchase> findList(BusPurchase busPurchase) {
		List<BusPurchase> busPurchaseList = super.findList(busPurchase);
        return busPurchaseList;
    }

    /**
     * 分页查询采购单信息列表
     * @param busPurchase 采购单信息
     * @return 采购单信息
     */
    @Override
    public PageInfo<BusPurchase> findPage(BusPurchase busPurchase) {
		PageInfo<BusPurchase> page = super.findPage(busPurchase);
        return page;
    }

    /**
     * 保存采购单信息
     * @param busPurchase
     * @return 结果
     */
    @Override
    public boolean save(BusPurchase busPurchase) {
        return super.save(busPurchase);
    }

    /**
     * 删除采购单信息信息
     * @param busPurchase
     * @return 结果
     */
    @Override
    public boolean remove(BusPurchase busPurchase) {
        return super.remove(busPurchase);
    }

    /**
     * 批量删除采购单信息
     * @param ids 需要删除的采购单信息ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBusPurchaseByIds(String[] ids) {
        return mapper.deleteBusPurchaseByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

}
